/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cn.jhelper.unit06.demo;

import java.util.Vector;

/**
 *
 * @author Administrator
 */
public class VectorDemo3 {

    public static void main(String[] args) {
        Vector v2 = new Vector();
        for (int i = 1; i <= 10; i++) {
            v2.add("第" + i + "个小孩");

        }
        System.out.println(v2);

        for (;;) {
            if (v2.size() == 1) {
                break;
            }
            for (int k = 0; k < 2; k++) {
                v2.add(v2.get(0));
                v2.remove(0);
                System.out.print("当前容器的内容是：");
                System.out.println(v2);
            }
            v2.remove(0);


        }
        System.out.println("最后容器的内容是：");
        System.out.println(v2);
    }
}
